﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Samples.RequestHandlers
{
	public class GetBorrowerRaiseException : Albatross.ServerSide.Messaging.RequestHandler<Samples.Contract.RequestsAndResponses.GetBorrowerRaisesExceptionI>
  {
		public override Albatross.Common.Messaging.Response Handle( Samples.Contract.RequestsAndResponses.GetBorrowerRaisesExceptionI request )
    {
		var response = new Samples.Contract.RequestsAndResponses.GetBorrowerRaisesExceptionO();

      int i = 0;
      int j = 1;
      int k = j / i;

	  response.MyBorrower = new Samples.Entities.Borrower()
      {
        FirstName = "Marilyn",
        LastName = "Manson"
      };
      return response;
    }
  }

  public class GetBorrowerRaiseException2 : Albatross.ServerSide.Messaging.RequestHandler<Samples.Contract.RequestsAndResponses.GetBorrowerRaisesException2I>
  {
    public override Albatross.Common.Messaging.Response OnException(Exception ex)
    {
      var response = new Samples.Contract.RequestsAndResponses.GetBorrowerRaisesException2O();
      response.StatusType = -1;
      response.ExceptionMessage = ex.Message;
      return response;
    }

    public override Albatross.Common.Messaging.Response Handle(Samples.Contract.RequestsAndResponses.GetBorrowerRaisesException2I request)
    {
      var response = new Samples.Contract.RequestsAndResponses.GetBorrowerRaisesException2O();

      int i = 0;
      int j = 1;
      int k = j / i;

      response.MyBorrower = new Samples.Entities.Borrower()
      {
        FirstName = "Marilyn",
        LastName = "Manson"
      };
      return response;
    }
  }

}
